﻿//------------------------------------------------------------------------------
// <copyright file="DefaultModiferFlags.cs" company="Robert MacLean">
//      Copyright © Robert MacLean.  All Rights Reserved.
// </copyright>
//
//  Details on this see: http://rule18.codeplex.com
//  This code released under the terms of the 
//  Microsoft Reciprocal License (MS-RL, http://opensource.org/licenses/ms-rl.html.)
//------------------------------------------------------------------------------

namespace Rule18.Core
{
    using System;

    /// <summary>
    /// 
    /// </summary>
    internal enum DefaultModifierFlags
    {
        /// <summary>
        /// 
        /// </summary>
        Ctrl = 0,
        /// <summary>
        /// 
        /// </summary>
        Alt = 1,
        /// <summary>
        /// 
        /// </summary>
        CtrlAlt = 2,
        /// <summary>
        /// 
        /// </summary>
        CtrlShift = 3,
        /// <summary>
        /// 
        /// </summary>
        AltShift = 4,
        /// <summary>
        /// 
        /// </summary>
        CtrlAltShift = 5
    }

    /// <summary>
    /// 
    /// </summary>
    internal static class DefaultModifierFlagsExtensions
    {
        internal static bool CtrlSet(this DefaultModifierFlags modifierFlags)
        {
            return modifierFlags == DefaultModifierFlags.Ctrl ||
                modifierFlags == DefaultModifierFlags.CtrlAlt ||
                modifierFlags == DefaultModifierFlags.CtrlAltShift ||
                modifierFlags == DefaultModifierFlags.CtrlShift;
        }

        internal static bool AltSet(this DefaultModifierFlags modifierFlags)
        {
            return modifierFlags == DefaultModifierFlags.Alt ||
                modifierFlags == DefaultModifierFlags.CtrlAlt ||
                modifierFlags == DefaultModifierFlags.CtrlAltShift ||
                modifierFlags == DefaultModifierFlags.AltShift;
        }

        internal static bool ShiftSet(this DefaultModifierFlags modifierFlags)
        {
            return modifierFlags == DefaultModifierFlags.AltShift ||
                modifierFlags == DefaultModifierFlags.CtrlShift ||
                modifierFlags == DefaultModifierFlags.CtrlAltShift;
        }
    }
}
